Repository navigation
ci: token smart contract tests (executor harness and private testnet) - #127
Merged
Merged
Conversation
ci/contracts/executor_harness.py drives contract executors directly through their Thrift interface, with a stub of the node's APIEXEC service, the way the node does: deploys, calls, getters, getContractMethods. token_scenarios.py runs token contracts of every API generation (v0/v1/v2 standards, payable, emitted transactions, failing calls, contract-to-contract calls, contract code that never returns) and records each executor's answers. With two jars, any answer that differs from the first jar's (the release executor) fails the run. ci/testnet/tokens.py (run.sh TOKENS=1, with CONTRACTS=1) deploys a v1 and a v0 token on the private network, runs transfers, approvals, payable and a sale through n1 (or TOKENS_VIA, e.g. the node of the restart test), and checks the balances on every node, the states, and the token API ([api] tokens_cache=true).
This was referenced Oct 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests for token smart contracts, without changes to the node.
ci/contracts/executor_harness.py+token_scenarios.pydrive one or more contract-executor jars directly through their Thrift interface, with a stub of the node's APIEXEC service (fixed seed, balances, block time), the way the node drives them: deploys (executeByteCodewith an empty state), calls (kept only when they succeed), getters (executeByteCodeMultiple),getContractMethods. Each step records status, return value, a hash of every returned state and the emitted transactions; with two jars any step that differs from the first jar (the release executor 1518) fails the run. Scenarios:getContractMethods(v0/v1/v2);TokenV1.java, ExtensionTokenStandard, BigDecimal) and a v0 token (TokenV0.java) through transfer, approve/transferFrom, failing calls, freeze, burn, register,balanceOffor 54 holders, payable as the node sends it, a sale with emitted CS;double, a contract-to-contract call (fails on 1518), contract code that never returns outside a method (name check, serialization).ci/testnet/tokens.py(run.shwithCONTRACTS=1 TOKENS=1): from the wallet of the last node, once fund.py's load is over, deploys both tokens on the private network and runs the same operations through n1 (orTOKENS_VIA=N, e.g. the node of the restart test once it restarted). Checks the balances read on every node, the same state on every node, the CS of the sale, and the token API ([api] tokens_cache=trueis written to the config; API mismatches are reported,TOKENS_STRICT_API=1fails on them).Test plan
NODES=5 CONTRACTS=1 TOKENS=1: 0 failures on master (the token API reports "doesn't provide such info", reported as a finding)RESTART_NODES=5 RESTART_AT=100 TOKENS_VIA=5: reproduces the quick-start bug fixed by api: contract results after a quick start at the last stored block #126 on master🤖 Generated with Claude Code